/*
  票面数据转换对应表名
  作者：刘明星
  函数：tableName
  参数：
    1.data为,分割字符串
  返回：转换对应表名
*/

export function tableName (data) {
  if (data.length !== 0) {
    for (let index in data) {
      if (data[index] === '领导班子(校领导票)') {
          data[index] = 'schoolleader_leadership'
      }
      if (data[index] === '领导班子(同级票)') {
          data[index] = 'samelevel_leadership'
      }
      if (data[index] === '领导班子(教辅群众票)') {
          data[index] = 'crowd_leadership_fu'
      }
      if (data[index] === '领导班子(教学群众票)') {
          data[index] = 'crowd_leadership_teach'
      }
      if (data[index] === '领导班子(教辅服务对象票)') {
          data[index] = 'service_fu'
      }
      if (data[index] === '所有中层干部(校领导票)') {
          data[index] = 'schoolleader_middlecadres'
      }
      if (data[index] === '教学教辅中层干部(同级票)') {
          data[index] = 'samelevel_teach'
      }
      if (data[index] === '机关中层干部(同级票)') {
          data[index] = 'samelevel_organ'
      }
      if (data[index] === '教辅中层干部(服务对象票)') {
          data[index] = 'service_teach'
      }
      if (data[index] === '机关中层干部(服务对象票)') {
          data[index] = 'service_organ'
      }
      if (data[index] === '中层干部(群众票)') {
          data[index] = 'crowd_middleleader'
      }
    }
  }
  var tableNameArr = data.join(',')
  return tableNameArr
}

export default {tableName}
